Optimal. Leaf size=14 \[ x^2-x \tan (x)-\log (\cos (x)) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.03, antiderivative size = 14, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, integrand size = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.400, Rules used = {4431, 3720, 3475, 30} \[ x^2-x \tan (x)-\log (\cos (x)) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 30
Rule 3475
Rule 3720
Rule 4431
Rubi steps
\begin {align*} \int x \cos (2 x) \sec ^2(x) \, dx &=\int \left (x-x \tan ^2(x)\right ) \, dx\\ &=\frac {x^2}{2}-\int x \tan ^2(x) \, dx\\ &=\frac {x^2}{2}-x \tan (x)+\int x \, dx+\int \tan (x) \, dx\\ &=x^2-\log (\cos (x))-x \tan (x)\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.02, size = 14, normalized size = 1.00 \[ x^2-x \tan (x)-\log (\cos (x)) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.56, size = 26, normalized size = 1.86 \[ \frac {x^{2} \cos \relax (x) - \cos \relax (x) \log \left (-\cos \relax (x)\right ) - x \sin \relax (x)}{\cos \relax (x)} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 1.55, size = 118, normalized size = 8.43 \[ \frac {2 \, x^{2} \tan \left (\frac {1}{2} \, x\right )^{2} - \log \left (\frac {4 \, {\left (\tan \left (\frac {1}{2} \, x\right )^{4} - 2 \, \tan \left (\frac {1}{2} \, x\right )^{2} + 1\right )}}{\tan \left (\frac {1}{2} \, x\right )^{4} + 2 \, \tan \left (\frac {1}{2} \, x\right )^{2} + 1}\right ) \tan \left (\frac {1}{2} \, x\right )^{2} - 2 \, x^{2} + 4 \, x \tan \left (\frac {1}{2} \, x\right ) + \log \left (\frac {4 \, {\left (\tan \left (\frac {1}{2} \, x\right )^{4} - 2 \, \tan \left (\frac {1}{2} \, x\right )^{2} + 1\right )}}{\tan \left (\frac {1}{2} \, x\right )^{4} + 2 \, \tan \left (\frac {1}{2} \, x\right )^{2} + 1}\right )}{2 \, {\left (\tan \left (\frac {1}{2} \, x\right )^{2} - 1\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.06, size = 15, normalized size = 1.07 \[ x^{2}-\ln \left (\cos \relax (x )\right )-x \tan \relax (x ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 0.42, size = 111, normalized size = 7.93 \[ \frac {2 \, x^{2} \cos \left (2 \, x\right )^{2} + 2 \, x^{2} \sin \left (2 \, x\right )^{2} + 4 \, x^{2} \cos \left (2 \, x\right ) + 2 \, x^{2} - {\left (\cos \left (2 \, x\right )^{2} + \sin \left (2 \, x\right )^{2} + 2 \, \cos \left (2 \, x\right ) + 1\right )} \log \left (\cos \left (2 \, x\right )^{2} + \sin \left (2 \, x\right )^{2} + 2 \, \cos \left (2 \, x\right ) + 1\right ) - 4 \, x \sin \left (2 \, x\right )}{2 \, {\left (\cos \left (2 \, x\right )^{2} + \sin \left (2 \, x\right )^{2} + 2 \, \cos \left (2 \, x\right ) + 1\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 2.35, size = 31, normalized size = 2.21 \[ x^2-\ln \left ({\mathrm {e}}^{x\,2{}\mathrm {i}}+1\right )+x\,2{}\mathrm {i}-\frac {x\,2{}\mathrm {i}}{{\mathrm {e}}^{x\,2{}\mathrm {i}}+1} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [B] time = 5.74, size = 144, normalized size = 10.29 \[ x^{2} + \frac {2 x \tan {\left (\frac {x}{2} \right )}}{\tan ^{2}{\left (\frac {x}{2} \right )} - 1} - \frac {\log {\left (\tan {\left (\frac {x}{2} \right )} - 1 \right )} \tan ^{2}{\left (\frac {x}{2} \right )}}{\tan ^{2}{\left (\frac {x}{2} \right )} - 1} + \frac {\log {\left (\tan {\left (\frac {x}{2} \right )} - 1 \right )}}{\tan ^{2}{\left (\frac {x}{2} \right )} - 1} - \frac {\log {\left (\tan {\left (\frac {x}{2} \right )} + 1 \right )} \tan ^{2}{\left (\frac {x}{2} \right )}}{\tan ^{2}{\left (\frac {x}{2} \right )} - 1} + \frac {\log {\left (\tan {\left (\frac {x}{2} \right )} + 1 \right )}}{\tan ^{2}{\left (\frac {x}{2} \right )} - 1} + \frac {\log {\left (\tan ^{2}{\left (\frac {x}{2} \right )} + 1 \right )} \tan ^{2}{\left (\frac {x}{2} \right )}}{\tan ^{2}{\left (\frac {x}{2} \right )} - 1} - \frac {\log {\left (\tan ^{2}{\left (\frac {x}{2} \right )} + 1 \right )}}{\tan ^{2}{\left (\frac {x}{2} \right )} - 1} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________